package so.sao.code.service.domain;

import so.sao.code.service.domain.entity.ThirdPartyCodeFileRecord;

/**
 * 第三方上传码文件信息包装。
 */
public class ThirdPartyCodeFileInfoWrapper implements ThirdPartyCodeFileInfoProvider {

	ThirdPartyCodeFileRecord record;

	Integer capCount;

	Integer packageCount;

	CodeType codeType;

	FileType fileType;

	String md5;

	String localPath;

	String parsePassWord;
	
	/**
	 * message ID
	 */
	private String messageId;

	public String getLocalPath() {
		return localPath;
	}

	public void setLocalPath(String localPath) {
		this.localPath = localPath;
	}

	public Integer getCapCount() {
		if (record != null) {
			return record.getCapCount();
		}
		return capCount;
	}

	public void setCapCount(Integer capCount) {
		this.capCount = capCount;
	}

	public Integer getPackageCount() {
		if (record != null) {
			return record.getPackageCount();
		}
		return packageCount;
	}

	public void setPackageCount(Integer packageCount) {
		this.packageCount = packageCount;
	}

	public CodeType getCodeType() {
		if (record != null) {
			return record.getCodeType();
		}
		return codeType;
	}

	public void setCodeType(CodeType codeType) {
		this.codeType = codeType;
	}

	public FileType getFileType() {
		if (record != null) {
			return record.getFileType();
		}
		return fileType;
	}

	public void setFileType(FileType fileType) {
		this.fileType = fileType;
	}

	public String getMd5() {
		return md5;
	}

	public void setMd5(String md5) {
		this.md5 = md5;
	}

	public String getFileName() {
		if (record != null) {
			return record.getFileName();
		}
		return null;
	}

	public String getParsePassWord() {
		if (record != null) {
			return record.getParsePassWord();
		}
		return parsePassWord;
	}

	public void setParsePassWord(String parsePassWord) {
		this.parsePassWord = parsePassWord;
	}

	public ThirdPartyCodeFileRecord getRecord() {
		return record;
	}

	public void setRecord(ThirdPartyCodeFileRecord record) {
		this.record = record;
	}

	@Override
	public String getContainerName() {
		if (record != null) {
			return record.getContainerName();
		}
		return null;
	}

	@Override
	public String getFilePath() {
		if (record != null) {
			return record.getFilePath();
		}
		return null;
	}

	@Override
	public Long getRecordId() {
		if (record != null) {
			return record.getId();
		}
		return null;
	}

	public String getMessageId() {
		if (record != null&&record.getMessageId()!=null) {
			return record.getMessageId();
		}
		return messageId;
	}

	public void setMessageId(String messageId) {
		this.messageId = messageId;
	}
	
	

}
